<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>kq.1.06文件模块的上传</title>
<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no">
<script src="../kq.1.06.dev.js"></script>
</head>

<body>
<button id="upload">点我单文件上传</button>
<button id="uploadmore">点我多文件上传</button>
</body>
<script>
$Q.config('DEBUG',true);
</script>
<script>
var file = null;
$Q('#upload').click(function(){
	//初始化一个文件对象
	file = new $Q.file();
	file.secSize = 100000;
	file.onprogress = function(rs){console.log('上传进度变更');console.log(rs);}
	file.onsuccess = function(rs){console.log('上传完成');}
	file.onerror = function(rs){console.log('上传失败');}
	file.oncompress = function(rs){console.log('压缩每个片段会出发本函数');console.log(rs);}//压缩每个片段会出发本函数
	//选取本地资源作为上传资源
	file.createBynone(function(){
		console.log('创建文件对象');
		file.upload('http://api.kuoqps.com/Resource/Demo');//文件部分上传
		
	});
	
});
</script>
<script>
$Q('#uploadmore').click(function(){
	var files = new $Q.files();	
	files.createBynone(function(){
		console.log('请拾取文件信息');
		console.log(this);
	});
	console.log(files);	
});
</script>
<script>
</script>
</html>
